<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = [10, 20, 30, 40];
        var result = arr.join('|');
        console.log(result);


        [undefined, null].join('#')
        // '#'


        // ['a',, 'b'].join('-')
        // 'a--b'

        var arr1 = ["hello", "world"];
        var result = arr1.join(" ");   //hello world
        console.log(result.split(" "));  ["hello" ,"world"];
        

    </script>
</body>

</html>